<?php 
	header("Content-type: image/png");
	//创建画布
	$src = imageCreateTrueColor(400,200); 
	//给画布加颜色
	$color = imagecolorallocate($src, mt_rand(0,255), mt_rand(0,255), mt_rand(0,255));
	//填充颜色
	imagefill($src, 0, 0, $color);
	
	//画线条
	imageline ($src, mt_rand(0,400), 0 ,mt_rand(0,400), 200, $color );
	//产生若干随机线条

	

	for ($i=0; $i < 4; $i++) { 
			$str = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
			$code = $str[mt_rand(0,strlen($str)-1)];
			$color = imagecolorallocate($src, mt_rand(0,255), mt_rand(0,255), mt_rand(0,255));

	    $width = $i*90;

		$width+=10;

		$height = mt_rand(150,180);
			imagettftext ($src , 150, mt_rand(-30,40),  $width , $height, $color , './HalfTones.ttf' , $code );
	}
		for($i = 0;$i<100;$i++){
		$color = imagecolorallocate($src, mt_rand(0,255), mt_rand(0,255), mt_rand(0,255));
		imageline ($src, mt_rand(0,400), 0 ,mt_rand(0,400), 200, $color );
	}
	//产生若干随机的点点
	for ($i=0; $i < 10000; $i++) { 
		$color = imagecolorallocate($src, mt_rand(0,255), mt_rand(0,255), mt_rand(0,255));
		imagesetpixel ( $src ,mt_rand(0,400) ,mt_rand(0,200), $color );
	}

	
	imagepng($src);























 ?>